CNN Host Installation on Linux

In a Hybrid deployment you use the power of our Cloud conversational engine but you use one DRUID-specific component which will store all the conversational data in your infrastructure. In Hybrid deployments, the Druid bots running in the Druid Cloud are integrated with on premise apps. The bots and on premise apps communicate via the Druid Connector Host installed on your local servers, usually hosted in your DMZ zone.

This section describes the CNN Host installation procedure using Linux docker containers.

General Prerequisites

  • Make a request to Druid Tech Support to activate the Hybrid-mode for your tenant.
    • Provide your tenant code. The tenant code is mentioned as parameter {{YOUR-TENANT-NAME}} throughout this section.
    • After the tenant has been activated for Hybrid-mode, you will receive from Druid team the values for some variables to be used during installation:
    • Variable Description
      {{Druid-CONNECTOR-VERSION}} The Technical code of the CNN version.
      {{Druid-LOGIN-ID}} User Id to connect to Druid repository.
      {{Druid-LOGIN-PASSWORD}} The Password for {{Druid-LOGIN-ID}}.
  • You have an admin account to access your Druid Online tenant.
  • Create dedicated user in Druid Portal, with "Druid Backend API" permissions (the parameter is {{WEB-API-USER-NAME}}).

Infrastructure Prerequisites

DB Server

You can use a dedicated server or a shared instance.

Hardware requirements

Item

Testing Environment

Production Environment

CPU count

1

2

CPU Type

Proc Intel i7 gen 8 min or equivalent Xeon.

 

RAM

4 Gib

8 Gib

Storage Type

Min 500 IOPS

 

Storage Size

OS: 120 GiB

OS: 120 GiB

 

Data: 10 GiB

Data: 100 GiB

Software requirements
  • OS: Windows 2016 (or newer) – updates “up to date”.
  • SQL Server Express Edition 2016 or later (up to 10GiB) or Standard Edition 2016 or later:
    • Collation: Latin1_General_CI_AS
    • Windows and SQL Server Authentication mode enabled.
    • TCP Protocol enabled (in SQL Server Configuration Manager). SQL Server port is open in the firewall of the DB Server. The port must be fix port and not dynamically allocated.
  • SQL Server Management Studio (SSMS). Alternatively, you can use Azure Data Studio or osql utility to run T-SQL statements necessary in installation process.

Connector Host Server (CNN)

CNN Hardware requirements

Item

Testing Environment

Production Environment

CPU count

2

4

CPU Type

Proc Intel i7 gen 8 min or equivalent Xeon.

 

RAM

8 GiB

16 GiB

Storage Type

Min 500 IOPS.

 

File system layout

Directory

Description

Testing Environment

Production Environment

/

Root, boot

30 GiB

50 GiB

/opt/Druid

Druid Platform application directory

10 GiB

100 GiB

/var/lib/docker

Docker service directory

30 GiB

50 GiB

/tmp

Temporary directory

20 GiB

20 GiB

CNN Software requirements
  • OS: Linux
    • min kernel 3.10 under one of the following distributions:
      • Debian 10
      • Ubuntu 18.04 LTS
      • RedHat 7.x
      • CentOS 7
    • latest updates are installed Additional software
  • Docker
    • Docker compose

Network Matrix

Source Name IP URL Destination Name IP URL Protocol Port Function Used at
CNN machine name TBD N/A DB Server name TBD N/A TCP 1433 Conversation History - MS SQL Server InStance Utilization
      N/A

52.236.186.66

13.69.106.64

13.69.64.64

prod2-Druidbus.servicebus.windows.net AMQPS 5671 Druid Service BUS (used for messages exchange) Utilization
      N/A N/A {{YOUR-TENANT-NAME}}. Druidplatform.com HTTPS 443 Druid Platform stored in Azure EU Utilization
      N/A N/A prodDruidbot.blob.core.windows.net HTTPS 443 Druid Platform Blob storage (required for in-transit user uploads, with archived data size bigger than 250KB) Utilization
      TBD TBD TBD TBD TBD Used to connect to any other enterprise services (e.g. UIPath orchestrator) – to be defined based on the needs Utilization
      N/A N/A Druidcontainerregistry.azurecr.io HTTPS 443 Druid containers' repositories Installation
      N/A N/A

https://auth.docker.io

https://dseasb33srnrn.cloudfront.net

https://elb-io.us-east-1.aws.dckr.io

https://elb-registry.us-east- 1.aws.dckr.io https://index.docker.io

https://registry-1.docker.io

https://registry-origin.docker.io

HTTPS 443 Docker container registry Installation
                   

Once you meet all the prerequisites, you can install Druid Connector Host on Linux.

Install the DB Server (one-time activities)

  1. In your SQL Server instance, create CNN database with collation SQL_Latin1_General_CP1_CI_AS: Druid Platform Connector-Host database {{CONNECTOR-DB-NAME}}.
  2. You can create the database by using the SSMS interface, or by using the following query:
  3. Copy
    use master
    go
    create database [{{CONNECTOR-DB-NAME}}]
    go

    Note:   Replace {{CONNECTOR-DB-NAME}} with the name you have chosen before running the query.
  4. In your SQL Server instance, create the login who will have the dbOwner role against the CNN database. This user must have SQL Server authentication type and assigned to public role (that is, the default one). Make sure the check boxes Enforce password policy and Enforce password expiration are not checked. You can create the login by either using the SSMS interface, or the following query:
  5. Copy
    use master
    go
    create login [{{DB-OWNER-USER}}] with password=N'{{DB-OWNER-USER-PASSWORD}}', default_database=[master], check_expiration=OFF, check_policy=OFF
    go

    Note:  Replace {{DB-OWNER-USER}} with the username and {{DB-OWNER-USER-PASSWORD}} with the password.
  6. Set the database owner to newly created Login for each Druid Platform databases:
  7. Copy
    use [{{CONNECTOR-DB-NAME}}]
    go
    exec sp_changedbowner '{{DB-OWNER-USER}}'
    go

  8. Check SQL Server connection:
    1. By using any SQL Server client (e.g., SSMS, osql, etc.) try connection to the recently configured databases and use {{DB-OWNER-USER}} as credential.
    2. Be sure that your SQL Server instance is accessible from the CNN machine via its configured port (e.g., 1433).

Install the Connector Host Server (one-time activities)

This section covers all the necessary steps to install CNN Host on a Linux machine (hosting Druid Connector containers). To easily operate, you need to perform all steps in elevated mode; therefore, before starting the installation, run the following command:

Copy
sudo -s
  1. Ensure latest updates are installed.
  2. Copy

    Debian / Ubuntu

    apt update && apt upgrade -y && apt autoremove -y

    Copy

    RHEL / CentOS

    yum update -y

  3. Install Docker.
  4. Linux Distribution Installation Steps
    Debian https://docs.docker.com/engine/install/debian/
    Ubuntu https://docs.docker.com/engine/install/ubuntu/
    Red Hat Enterprise Linux https://docs.docker.com/engine/install/rhel/
    CentOS https://docs.docker.com/engine/install/centos/
  5. Configure Docker to start on boot.
  6. Copy
    systemctl enable docker

  7. Confirm the right execution of the docker:
  8. Copy
    docker run hello-world

    Note:   The output should look like in the figure below.

  9. Remove the hello-world container and image:
  10. Copy
    docker rm $(docker ps -aq -f "ancestor=hello-world") --force
    docker image rm $(docker images hello-world -q)

  11. Install docker-compose.
    1. Run the following command to download the current stable release of Docker Compose:
    2. Copy
      curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

    3. Apply executable permissions to the binary:
    4. Copy
      chmod +x /usr/local/bin/docker-compose

    5. Test the installation of docker-compose.
    6. Copy
      docker-compose --version

Install the Connector Host Server

Note:  This section describes the installation procedure of Druid Connector Host on DEV environments. For installation on PROD environments, you need to perform additional steps which are specified inline as notes throughout this section.
  1. Click the button below to download the installation package, Druid-cnn.tar.gz.
  2. Upload it on the Linux machine to the /tmp directory.
  3. Extract the content of the archive:
  4. Copy
    mkdir -p /tmp/Druid-cnn cd /tmp
    tar -xzvf Druid-cnn.tar.gz -C /tmp/Druid-cnn

    Ignore the following warning message if it appears "tar: A lone zero block at 1230168".

    For PROD installations:
    1. Rename the file /tmp/Druid-cnn/Druid.opt/dc.files/dev.env to /tmp/Druid-cnn/Druid.opt/dc.files/prod.env.
    2. Rename the directory /tmp/Druid-cnn/Druid.opt/dev to /tmp/Druid-cnn/Druid.opt/prod.
    3. Edit the file /tmp/Druid-cnn/Druid.opt/dc.files/prod.env and change the line COMPOSE_PROJECT_NAME=dev to COMPOSE_PROJECT_NAME=prod.
  5. Create the application directory.
  6. Copy
    mkdir -p /opt/Druid
    chown -R root:root /opt/Druid

  7. Copy the directory structure.
  8. Copy
    cp -r /tmp/Druid-cnn/Druid.opt/* /opt/Druid

  9. Parametrize the application. Edit the file /opt/Druid/dc.files/dev.env and update the values of the variables described in the table below (replace them with their actual values):
  10. Note:  For PROD installations, the file is /opt/Druid/dc.files/prod.env.
    Variable Description
    {{Druid-CONNECTOR-VERSION}} The Technical code of the CNN version
    {{YOUR-TENANT-NAME}} Your tenant code assigned by the Druid team
    {{WEB-API-USER-NAME}} Technical user used for programmatic access to the Druid Platform API.
    {{WEB-API-USER-PASSWORD}} The password of {{WEB-API-USER-NAME}}.
    {{SQL-SERVER-NAME}} The SQL Server instance to store the CNN's conversation-history database, e.g. SQLDEV,1433.
    {{CONNECTOR-DB-NAME}} CNN’s conversation history database.
    {{DB-OWNER-USER}} The dbowner of the Druid SQL databases.
    {{DB-OWNER-USER-PASSWORD}} The password of {{DB-OWNER-USER}}.
  11. Manage the Druid CNN Host certificate.
    1. In a browser, access the Druid Portal (https://{{YOUR-TENANT-NAME}}.Druidplatform.com) and, on the Administration menu, click Connector Certificate. Click Actions > Download.
    2. The downloaded file name pattern is {{YOUR-TENANT-NAME}}-[start-validity-date]-[end-validity-date](guid).pfx.

    3. Rename the downloaded file to <guid>.pfx. For example, from the current name test-20220321-20320321(0d9f61d7-bdf5-409c-853cce9d133747d5).pfx rename to 0d9f61d7-bdf5-409c-853c-ce9d133747d5.pfx
    4. Upload the file to Linux machine to the directory: /opt/Druid/dev/cert/cert.
    5. Note:  For installation on PROD environments, the destination directory is /opt/Druid/prod/cert/cert.
    6. Make sure that the uploaded file has Read right:
    7. Copy
      chmod +r /opt/Druid/dev/cert/cert/{{GUID}}.pfx

      Note:  Do replace {{GUID}} before use.
  12. Authenticate to Druid's container repository.
    1. Execute the following command after replacing the variables with their values:
    2. Copy
      docker login Druidcontainerregistry.azurecr.io -u {{Druid-LOGIN-ID}}

    3. Type the password {{Druid-LOGIN-PASSWORD}}
    4. Note:  The expected system response is "Login Succeeded".
  13. Start Druid CNN Host.
  14. Copy

    On DEV environments

    cd /opt/Druid/dc.files
    docker-compose --env-file dev.env up -d

    Copy

    On PROD environments

    cd /opt/Druid/dc.files
    docker-compose --env-file prod.env up -d

  15. Check the status.
  16. Copy
    watch docker ps -a

    The response would be similar to:

    Copy
    Every 2.0s: docker ps -a
    CONTAINER ID    IMAGE                                                                 COMMAND                   CREATED                             STATUS                PORTS        NAMES
    b5e5ff091ca0    Druidcontainerregistry.azurecr.io/Druidconnector:1.61.0-beta.1-2    "./App_Data/start-cn…" 20    seconds ago Up 19 seconds    (health: starting)    12345/tcp    Druidconnector-dev

    Note:   Wait until the status become Healthy.